/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bionic.socialNet.commandBeans;

import com.bionic.socialNet.dao.interfaces.IMessageDAO;
import com.bionic.socialNet.dao.interfaces.IUserConnectionsDAO;
import com.bionic.socialNet.db.DB;
import com.bionic.socialNet.entities.MessageData;
import com.bionic.socialNet.entities.ProfileData;
import com.bionic.socialNet.manager.DictionaryValues;
import java.util.ArrayList;

/**
 *
 * @author Ann Class contains user's friends information: friends list an friend
 * request messages
 */
public class UserConnectionsBean {

    private IUserConnectionsDAO UserConnections;
    // messages - friend requests 
    private IMessageDAO Messages;

    public UserConnectionsBean() {
        UserConnections = DB.getInstance().getFactory().getUserConnectionsDAO();
        Messages = DB.getInstance().getFactory().getMessageDAO();
    }

    public ArrayList<ProfileData> getFriends(int userID) {
        return UserConnections.selectFriendsCollection(userID);
    }
    
    public ArrayList<MessageData> getFriendRequests(int userID){
       return  Messages.selectMessagesCollection(userID,DictionaryValues.MSG_TYPE_REQUEST);       
    }
}
